#include "comm.hpp"

int main()
{

    int fd = open(fifoname.c_str(), O_WRONLY);
    if (fd < 0)
    {
        std::cout << errno << ":" << strerror(errno);
        return 1;
    }
    char buf[1024];
    memset(buf, 0, sizeof(buf));
    while (true)
    {
        printf("请输入：");
        scanf("%s", buf);
        // buf[strlen(buf)] = 0;

        if (strcmp(buf, "quit!") == 0)
        {
            printf("我要退出了！\n");

            break;
        }
        write(fd, buf, strlen(buf));
    }
    close(fd);

    return 0;
}
